<?php
namespace app\common\logic;

use think\facade\Env;

class Redis extends Base {
    
    /**
     * @desc 初始化
     */
    public function initialize() {
        $config = [
            'host'       => Env::get('redis.hostname', '127.0.0.1'),
            'port'       => Env::get('redis.port', 6379),
            'password'   => Env::get('redis.auth', ''),
            'select'     => Env::get('redis.select', 0),
            'timeout'    => 0,
            'expire'     => 0,
            'persistent' => false,
            'prefix'     => '',
            'serialize'  => true,
        ];
        $redis = new  \think\cache\driver\Redis($config);
        return $redis->handler();
    }
    
}